#include "mainwindow.h"
#include "ui_mainwindow.h"
#include<QPushButton>
#include<QPixmap>
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    //setWindowState(Qt::WindowMaximized);
    this->setMinimumSize(800,600);
    this->setWindowIcon(QPixmap(":/new/Camera Roll/XH.jpeg"));
    this->setWindowTitle("分子动力学模拟");



   //经典动力学按钮
    secondwindow * second =new secondwindow;
    connect(second,&secondwindow::secondBack,this,[=](){
        second->hide();
        this->show();
    });
    connect(ui->pushButton,&QPushButton::clicked,[=](){
        this->hide();
        second->show();

     });
    //量子动力学按钮
    secondwindow2 * second2 =new secondwindow2;
    connect(second2,&secondwindow2::second2Back,this,[=](){
        second2->hide();
        this->show();
    });
    connect(ui->pushButton_2,&QPushButton::clicked,[=](){
        this->hide();
        second2->show();

     });
}

//void MainWindow::paintEvent(QPaintEvent *)
//{
//    QPainter painter(this);
//    QPixmap pix;
//    pix.load(":/Camera Roll/MM.png");
//    painter.drawPixmap(0,0,this->width(),this->height(),pix);
//    //背景上的图
//    pix.load(":/Camera Roll/science.jpg");
//    painter.drawPixmap(350,100,400,400,pix);
//}

MainWindow::~MainWindow()
{
    delete ui;
}

